import { GCellRenderer } from "../../../../com/mui/controls/GCellRenderer";
import { BaseItem } from "../common/BaseItem";
import { GlobalClass } from "../../../../com/mui/core/GlobalClass";
import { ImagesConst } from "../../resource/ImagesConst";
import { GiftBagInfo } from "../../model/GiftBagInfo";
import { ItemData } from "../../resource/info/ItemData";
//class NoviceGiftItemRenderer
    
    export  class NoviceGiftItemRenderer extends GCellRenderer
    {
        constructor()
        {
            super();
            return;
        }

        public get item(): BaseItem
        {
            return this._item;
        }

        protected /* override */ configUI(): void
        {
            this._bg = GlobalClass.getBitmap(ImagesConst.PackItemBg);
            addChild(this._bg);
            this._item = new BaseItem();
            this._item.setSize(32, 32);
            this._item.move(3, 3);
            this._item.isDragAble = false;
            this._item.isDropAble = false;
            addChild(this._item);
            return;
        }

        public /* override */ set data(arg1: Object)
        {
            super.data = arg1;
            var loc1=arg1 as GiftBagInfo;
            if (!(loc1 == null) && !(loc1.code == 0)) 
            {
                this._item.amount = loc1.num;
                this._itemData = loc1.item;
                this._item.itemData = this._itemData;
            }
            else 
            {
                this._itemData = null;
                this._item.itemData = null;
            }
            return;
        }

        protected /* var */_item: BaseItem;

        protected /* var */_itemData: ItemData;

        protected /* var */_bg: Object /* flash.display.Bitmap */;
    }
